﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.XPath;

using GaugeEngine;

namespace GaugeEngineTest
{
    class MovesLeft : Behaviour
    {
        private float m_speed = 0.0f;
        public MovesLeft(Actor a, float speed)
            : base(a)
        {
            m_speed = speed;
        }

        public override void Update(GameTime gameTime)
        {
            ParentActor.Position.X -= m_speed;
        }

        public static Behaviour CreateMovesLeft(Game g, Actor a, XPathNavigator xnav)
        {
            float speed = Convert.ToSingle(xnav.GetAttribute("speed", ""));
            return new MovesLeft(a, speed);
        }
    }
}
